const fileSlice = require("./index.js");

async function test() {
  const sourFilePath = "README.md";
  const distFilePath = "./temp/README.md";
  const buffInfoArray = fileSlice.getSliceInfoArr(sourFilePath);
  if(!buffInfoArray){
      return console.log('file not found');
  }
  console.log(buffInfoArray);
  const blockArr = [];
  for (const info of buffInfoArray) {
    const buf=await fileSlice.readOneBlock(sourFilePath, info);
    blockArr.push(buf);
  }
  await fileSlice.joinBlcoksToFile(distFilePath,blockArr);
}
test().then(()=>{});